package o;

import android.graphics.Matrix;
import android.util.Log;
import android.view.View;
import androidx.annotation.NonNull;
import androidx.annotation.RequiresApi;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

@RequiresApi(21)
class of extends oh {
    private static boolean ʼ;
    private static boolean ˊ;
    private static Method ˋ;
    private static Method ˎ;
    private static Method ˏ;
    private static boolean ॱ;

    of() {
    }

    public void ˊ(@NonNull View view, @NonNull Matrix matrix) {
        ˎ();
        if (ˋ != null) {
            try {
                ˋ.invoke(view, new Object[]{matrix});
            } catch (IllegalAccessException e) {
            } catch (InvocationTargetException e2) {
                throw new RuntimeException(e2.getCause());
            }
        }
    }

    public void ॱ(@NonNull View view, @NonNull Matrix matrix) {
        ॱ();
        if (ˏ != null) {
            try {
                ˏ.invoke(view, new Object[]{matrix});
            } catch (IllegalAccessException e) {
            } catch (InvocationTargetException e2) {
                throw new RuntimeException(e2.getCause());
            }
        }
    }

    public void ˋ(@NonNull View view, Matrix matrix) {
        ˋ();
        if (ˎ != null) {
            try {
                ˎ.invoke(view, new Object[]{matrix});
            } catch (InvocationTargetException e) {
            } catch (IllegalAccessException e2) {
                throw new RuntimeException(e2.getCause());
            }
        }
    }

    private void ˎ() {
        if (!ॱ) {
            try {
                ˋ = View.class.getDeclaredMethod("transformMatrixToGlobal", new Class[]{Matrix.class});
                ˋ.setAccessible(true);
            } catch (Throwable e) {
                Log.i("ViewUtilsApi21", "Failed to retrieve transformMatrixToGlobal method", e);
            }
            ॱ = true;
        }
    }

    private void ॱ() {
        if (!ˊ) {
            try {
                ˏ = View.class.getDeclaredMethod("transformMatrixToLocal", new Class[]{Matrix.class});
                ˏ.setAccessible(true);
            } catch (Throwable e) {
                Log.i("ViewUtilsApi21", "Failed to retrieve transformMatrixToLocal method", e);
            }
            ˊ = true;
        }
    }

    private void ˋ() {
        if (!ʼ) {
            try {
                ˎ = View.class.getDeclaredMethod("setAnimationMatrix", new Class[]{Matrix.class});
                ˎ.setAccessible(true);
            } catch (Throwable e) {
                Log.i("ViewUtilsApi21", "Failed to retrieve setAnimationMatrix method", e);
            }
            ʼ = true;
        }
    }
}
